<?php
namespace wechat;


class WeChat{

    public function decrypt($sessionKey,$encryptedData,$iv)
    {
        $app_id=config('app_id');
        $pc = new wxBizDataCrypt($app_id, $sessionKey);
        $errCode = $pc->decryptData($encryptedData, $iv, $data );
        if ($errCode == 0) {
            return $data;
        } else {
           return $errCode;
        }
    }
}
